import {url,axios} from './index';
// import axios from 'axios';


export const  adminnameExist = async (adminName) => {
    let result = await axios({
        method:'post',
        url:url+'/admins/adminnameExist',
        //post及其他方式
        data:{
            adminName 
        }
        //get方式
        // params：{}
    })
    return result.data;
}
export const  register = async (data) => {
    let result = await axios({
        method:'post',
        url:url+'/admins/reg',
        //post及其他方式
        data
        //get方式
        // params：{}
    })
    return result.data;
}
export const  login = async (data) => {
    let result = await axios({
        method:'post',
        url:url+'/admins/login',
        //post及其他方式
        data
        //get方式
        // params：{}
    })
    return result.data;
}
export const getToken = async () => {
    let res = await axios({
        method:"get",
        url:url + "/getToken"
    });
    return res.data;
}